
#ifndef _LCD1232_H
#define _LCD1232_H

#include "main.h"

#define DAT 1               
#define CMD 0

/*===================================================================*-
==Will need to edit this section for your specific application
=====================================================================*/

/*------------Initialize LCM function define-------------------------------*/
#define FUNCTION        0x38            // Function setting, 8 bit data,basic instruction.
#define DISPLAY_ON_OFF  0x0C            // Dispay on,0x0E _cursor on ;0x0C off
#define ENTRY_MODE      0x14            // Cursor move by right
/*
#define DISPLAY_CURSOR_SHIFT
#define CGRAM_ADDR
*/
//if you want to use some of the functin below ,you need to enable it
#define LCDADDR_ENB         0 
#define DISPDECSPACE_ENB    0
#define DISPDECSPACEAT_ENB  1               
#define DISPDECSHIFT_ENB    0
#define DISPDECSHIFTAT_ENB  1
#define DISPSTR_ENB         0
#define DISPSTRAT_ENB       1
#define DISPCHAR_ENB        0
#define DISPCHARAT_ENB      0
#define SET_CURSOR_ON_ENB   0
/*===================================================================*-
==Will need to edit this section for your specific application
=====================================================================*/
// Connect LCD12232 control bus to those pins

sbit RS_LCD   = P2^7;
sbit RW_LCD   = P2^6;
sbit E_LCD    = P2^5; 

// Send data or command on this port
#define DB_LCD  P0        

/*----Interface Function Prototype-----------------------------------*/
void  InitLCD(); 
void  DispStr(uchar*);   //display string
void  DispStrAt(uchar*, uchar, uchar);
void  DispDecShift(ulong,uchar);
void  DispDecShiftAt(ulong, uchar, uchar, uchar);         //display number
void  DispDecSpace(ulong,uchar);
void  DispDecSpaceAt(ulong, uchar, uchar, uchar);
void  DispChar(const uchar); //display single character
void  DispCharAt(uchar, uchar, uchar);
uchar LCDInfo();
uchar LCDaddr();
void  SetCursorPos(const uchar x, const uchar y);
void  SetCursorOn(bit);
void  EraseLCD();

#endif

/*------------------------------------------------------------------*-
  ---- END OF FILE -------------------------------------------------
-*------------------------------------------------------------------*/

